]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
BackgroundManager: don't destroy the newly created actor
authorGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 22 Jan 2014 19:17:15 +0000 (20:17 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 22 Jan 2014 19:35:02 +0000 (20:35 +0100)
Because we were setting this.background before calling .destroy(),
the call that was meant to destroy the old background was actually
destroying the new one!

https://bugzilla.gnome.org/show_bug.cgi?id=722787

js/ui/background.js

index f4d486cf42b32189851f4ffbb3ebb4f8790add5a..3a7541cb5aa6c90fd898eb397cab81f4043fb498 100644 (file)
@@ -748,14 +748,16 @@ const BackgroundManager = new Lang.Class({
                                    time: FADE_ANIMATION_TIME,
                                    transition: 'easeOutQuad',
                                    onComplete: Lang.bind(this, function() {
-                                       if (this._newBackground == newBackground) {
-                                           this.background = newBackground;
-                                           this._newBackground = null;
-                                       } else {
+                                       if (this._newBackground != newBackground) {
+                                           /* Not interesting, we queued another load */
                                            newBackground.actor.destroy();
+                                           return;
                                        }
 
                                        this.background.actor.destroy();
+                                       this.background = newBackground;
+                                       this._newBackground = null;
+
                                        this.emit('changed');
                                    })
                                  });